package com.rent.reserve.mapper;

import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rent.reserve.domain.Reserve;
import org.apache.ibatis.annotations.Param;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 租房订单Mapper接口
 *
 * @author cooper
 * @date 2024-10-15
 */
public interface ReserveMapper extends BaseMapper<Reserve> {
    /**
     * 查询租房订单
     *
     * @param reserveId 租房订单主键
     * @return 租房订单
     */
    public Reserve selectReserveByReserveId(Long reserveId);

    /**
     * 查询租房订单列表
     *
     * @param reserve 租房订单
     * @return 租房订单集合
     */
    public List<Reserve> selectReserveList(Reserve reserve);

    /**
     * 新增租房订单
     *
     * @param reserve 租房订单
     * @return 结果
     */
    public int insertReserve(Reserve reserve);

    /**
     * 修改租房订单
     *
     * @param reserve 租房订单
     * @return 结果
     */
    public int updateReserve(Reserve reserve);

    /**
     * 删除租房订单
     *
     * @param reserveId 租房订单主键
     * @return 结果
     */
    public int deleteReserveByReserveId(Long reserveId);

    /**
     * 删除租房订单并更新公寓状态
     * 
     * @param reserveIds 要删除的租房订单ID数组
     * @return 影响的行数
     */
    public int deleteReserveByReserveIds(Long[] reserveIds);

    public int updateApartmentStatus(@Param("apartmentId") Long apartmentId, @Param("status") String status);
}